objs = boot.o main.o tasks.o timers.o list.o queue.o event_groups.o  sdram.o uart.o interrupt.o
objs += ./portable/MemMang/heap_4.o
objs += ./portable/ARM920T/port.o
objs += ./portable/ARM920T/portISR.o
CC = arm-linux-gcc
CFLAGS = -I /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/
CFLAGS += -I ./portable/ARM920T
CFLAGS += -I ./include
CFLAGS += -I .


all: $(objs)
	#arm-linux-ld -T s3c2440.lds $^ /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/lib/libc.a  /usr/local/arm/4.3.2/lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a -o s3c2440.elf
	arm-linux-ld -T s3c2440.lds $^ libgcc.a libc.a  -o s3c2440.elf
	arm-linux-objcopy -O binary -S s3c2440.elf s3c2440.bin
	

clean:
	rm *.bin *.o *.elf *.dis

distclean:
	rm $(dep_files)
	
%.o : %.c
	$(CC) -march=armv4t -c  $(CFLAGS) -o $@ $<

%.o : %.S
	$(CC) -c -o $@ $<
